package com.yx.front.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author YangXiong
 */
@Getter
@AllArgsConstructor
public enum CollectEnum {
    /**
     * 已收藏
     */
    YES(1, "已收藏"),
    /**
     * 未收藏
     */
    NO(0, "点击收藏");

    private final Integer code;
    private final String value;

    public static String getValueByCode(Integer code){
        for (CollectEnum anEnum : CollectEnum.values()) {
            if (anEnum.code.equals(code)) {
                return anEnum.value;
            }
        }
        return null;
    }
}
